package com.lw.function;

/**
 * @author LW
 * @2020/8/21 9:10
 */

import java.util.function.Function;

/**
 * Function 函数型接口
 */
public class Demo01 {

    public static void main(String[] args) {
        //传入参数T，返回类型R    Function<T, R>
        //R apply(T t);
        Function<String, String> function = new Function<String, String>() {
            @Override
            public String apply(String str) {
                return str;
            }
        };
        //
        Function<String, String> function1 = (str)->{return str;};

        System.out.println(function.apply("123"));
        System.out.println(function1.apply("==="));
    }
}
